﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using COM.Rights.Model;
using COM.Rights.BLL;
using System.Data;

public partial class Pages_View_Review_Product_Edit : ZMPageEdit<ProduceReviewInfo>
{
    #region 重写方法
    protected override void OnLoading()
    {
        if (!IsPostBack)
        {
            BingDropDownList(ProduceReviewInfo_Star);
            BindDefaultData();
        }
        base.OnLoading();
    }

    protected override void OnAchieved()
    {
        base.OnAchieved();
        Model.CheckBy = ZASession.Account;
        Model.ChectDate = DateTime.Now;
        Model.IsAuto = false;
    }
    #endregion 	重写方法

    private void BindDefaultData()
    {
        Random rnd = new Random();
        string ip = "";
        ip = ((rnd.Next(255)) + 1) + "." + (rnd.Next(255)) + "." + (rnd.Next(255)) + "." + (rnd.Next(255));
        ProduceReviewInfo_IP.Value = ip;
    }
    /// <summary>
    /// 绑定星级下拉框
    /// </summary>
    /// <summary>
    /// 绑定所有下拉框
    /// </summary>
    private void BingDropDownList(DropDownList ddl)
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("StarName");
        dt.Columns.Add("Star");
        dt.Rows.Add(new string[] { "1星", "1" });
        dt.Rows.Add(new string[] { "2星", "2" });
        dt.Rows.Add(new string[] { "3星", "3" });
        dt.Rows.Add(new string[] { "4星", "4" });
        dt.Rows.Add(new string[] { "5星", "5" });
        ddl.DataSource = dt;
        ddl.DataTextField = "StarName";
        ddl.DataValueField = "Star";
        ddl.DataBind();
    }
         

}